/**
 * 
 */
package com.bookdao.oasis.cms;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.bookdao.oasis.sys.model.po.CuWarningTemplatePO;
import com.bookdao.oasis.sys.service.CuWarningTemplateService;

/**
 * @author zhanghuajie
 *
 */
@Controller
@RequestMapping("/")
public class SpringBootControllerTest {
	
	private Log logger=LogFactory.getLog("testLog");
	private Log ortherLog=LogFactory.getLog("ortherLog");

	@Value("${server.context-path}")
	private String contextPath;
	@Autowired
	private CuWarningTemplateService cuWarningTemplateService;

	@RequestMapping("/index.html")
	public ModelAndView toIndex(){
		logger.info(">>>>>>>>>>>>>>>>>记录日志信息是：SpringBootControllerTest.toIndex");
		ortherLog.info(">>>>>>>>>>>>>>>>>记录日志信息是：SpringBootControllerTest.toIndex");
		//FreeMarkerProperties properties;
		//properties.setTemplateLoaderPath(templateLoaderPaths);
		CuWarningTemplatePO  cuWarningTemplatePO=(CuWarningTemplatePO)cuWarningTemplateService.selectByPrimaryKey("1034314095");
		ModelAndView modelAndView=new ModelAndView();
		System.out.println("aaaaaaaaaaaaaaaaaaa"+contextPath);
		modelAndView.addObject("name", "springboot");
		modelAndView.addObject("po", cuWarningTemplatePO);
		modelAndView.setViewName("index");
		logger.info("<<<<<<<<<<<<<<<<<<<<<<<<记录日志信息是：SpringBootControllerTest.toIndex");
		ortherLog.info("<<<<<<<<<<<<<<<<<<<<<<<<记录日志信息是：SpringBootControllerTest.toIndex");
		return modelAndView;
	}
}
